package com.haonan.controller;

import com.haonan.pojo.entily.Result;
import com.haonan.pojo.vo.JobVO;
import com.haonan.pojo.vo.StudentClazzVO;
import com.haonan.pojo.vo.StudentCountVO;
import com.haonan.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RequestMapping("/report")
@RestController
public class ReportController {
    @Autowired
    private ReportService reportService;

    @GetMapping("/empGenderData")
    public Result getGender(){
        List<Map<String,Object>> list=reportService.getEmpGenderData();
        return Result.success(list);
    }

    @GetMapping("/empJobData")
    public Result empJobData(){
      JobVO jobVO=reportService.getEmpJobData();
      return Result.success(jobVO);
    }

    @GetMapping("/studentDegreeData")
        public Result studentDegreeData(){
        List<StudentCountVO> list=reportService.getStudentDegreeData();
        return Result.success(list);
    }

    @GetMapping("/studentCountData")
    public Result studentCountData(){
        StudentClazzVO studentClazzVO=reportService.getStudentCountData();
        return Result.success(studentClazzVO);
    }
}
